using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;

namespace Quiki.ExpressionParsers
{
    public class WikiImageElement : WikiTextElement
    {
        public WikiImageElement() : base (WikiTextElementType.Image)
        {
            Terminal = true;
            ImageParameters = new List<string>();
        }

        public WikiImageElement(string name, params string[] parameters) 
            : this()
        {
            Name = name;
            foreach (string parameter in parameters)
                ImageParameters.Add(parameter);
        }

        public string Name
        {
            get { return (string) Properties["name"]; }
            set { Properties["name"] = value; }
        }

        [SuppressMessage ("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
        public IList<string> ImageParameters
        {
            get { return (IList<string>)Properties["parameters"]; }
            set { Properties["parameters"] = value; }
        }
    }
}